package cn.com.dodo.demo.datasource.service.impl;

import cn.com.dodo.demo.datasource.dao.h2.H2StudentMapper;
import cn.com.dodo.demo.datasource.dao.hsqldb.HsqldbStudentMapper;
import cn.com.dodo.demo.datasource.dao.sqlite.SqliteStudentMapper;
import cn.com.dodo.demo.datasource.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("studentService")
public class StudentServiceImp implements StudentService {
    @Autowired
    private SqliteStudentMapper sqliteStudentMapper;
    @Autowired
    private H2StudentMapper h2StudentMapper;
    @Autowired
    private HsqldbStudentMapper hsqldbStudentMapper;

    @Override
    public List<Map<String, Object>> getAllStudentsFromSqlite() {
        return this.sqliteStudentMapper.getAllStudents();
    }

    @Override
    public List<Map<String, Object>> getAllStudentsFromH2() {
        return this.h2StudentMapper.getAllStudents();
    }

    @Override
    public List<Map<String, Object>> getAllStudentsFromHsqldb() {
        return this.hsqldbStudentMapper.getAllStudents();
    }

}
